package logic

import (
	"context"
	"onerk4/yk/common/proto/user"
	"onerk4/yk/service/server"
)

type UserServer struct {
	user.UnimplementedUserServer
}

func (u UserServer) UserLogin(ctx context.Context, req *user.UserLoginRequest) (*user.UserLoginResponse, error) {
	login, err := server.UserLogin(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserServer) AddCourse(ctx context.Context, req *user.AddCourseRequest) (*user.AddCourseResponse, error) {
	login, err := server.AddCourse(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserServer) CourseList(ctx context.Context, req *user.CourseListRequest) (*user.CourseListResponse, error) {
	login, err := server.CourseList(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserServer) CourseInfo(ctx context.Context, req *user.CourseInfoRequest) (*user.CourseInfoResponse, error) {
	login, err := server.CourseInfo(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserServer) UpdateCourse(ctx context.Context, req *user.UpdateCourseRequest) (*user.UpdateCourseResponse, error) {
	login, err := server.UpdateCourse(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserServer) AddCoursePanic(ctx context.Context, req *user.AddCoursePanicRequest) (*user.AddCoursePanicResponse, error) {
	login, err := server.AddCoursePanic(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserServer) AddOrder(ctx context.Context, req *user.AddOrderRequest) (*user.AddOrderResponse, error) {
	login, err := server.AddOrder(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}
